import pygame
from pygame.lpcals import *
from sys import exit

pygame.init()
size=1000,600
screen = pygame.display.set_mode(size)
pygame.display.set_caption("垃圾分类 从我做起")
background_Image_Filename='assets/bg.jpg'
background=pygame.image.load(backgroundImageFilename)

While True:
   for event in pygame.event.get()
      if exent.type == QUIT:
          exit()
   screen.blit(background,(0,0))
   pygame.display.update()

mouseCursor = pygame.image.load('assets/gb.png').convert_alpha()
def mouse():
    x,y = pygame.mouse.get_pos()
    x -= mouseCursor.get_width()/2
    y -= mouseCursor.get_height()/2
    pygame.mouse.set_visible(False)
    screen.blit(background(x,y))

position = size[0] //2 , size[1] //2
garbage =[
    {'img':'assets/img/1.png','key':0},
    {'img':'assets/img/2.png','key':1},
    {'img':'assets/img/3.png','key':1},
    {'img':'assets/img/4.png','key':3},
    {'img':'assets/img/5.png','key':0},
]

moving = False
while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            exit()
        if event.type == pygame.pygame.MOUSEBUTTONDOWN:
            if event.button == 1:
                moving == True
        if event.type == pygame.MOUSEBUTTONUP:
            if event.button == 1:
                moving = False
        if moving == True:
            position = pygame.mouse

        import time
        ......
        score=0
        rightImg = pygame.image.load('assets/right.png').convert_alpha()
        wrongImg= pygame.image.load('assets/wrong.png').convert_alpha()
        while True:
            for event in pygame.event.get():
                ......
                if position[1] >= 440 and position[1] <= 600:
                    if position[0] >= 200 and position[0] <= 310:

                        score+=1
                        screen.blit(rightImg,(350,150))
                    else:
                        screen.blit()
                    pygame.display.flip()
                    randomNum = random.randint()
                    position = size[0] //2,size[1] //2
                    moving =False
                    time.sleep(0,5)
                ......
                ......

    def showText(text,x,y,size):
        screen.blit(frontbigObj.render(text,True,(0,0,0)),(x,y))
    while True:
        ......
        showText(     ,450,50,25)
        pygame.display.update()

    start = True
    counts=60
    COUNT = pygame.USEREVENT +1
    pygame.time.set_timer(COUNT,1000)

    while True:
        for event in pygame.event.get():
            ......
            if event.type == COUNT:
                if start:
                    counts = counts -1
                if counts <= 0 :
                    start = False
                if start:
                    if position[1]>=440 and position[1]<=600
                        if     :
                            ......
            if start:
                showText('当前剩余时间：'+str(counts),420,20,25)
                showText('当前分数：'+str(score),450,20,25)
                ......
            else:
                showText('游戏结束，最终分数：'+   ,340,250,50)
                ......
